@import './theme/index.scss';
@import './variables.scss';

body,
html {
  display: table;
  height: 100%;
  width: 100%;
  line-height: 1.5em;
}


.default-theme,
.blue-theme,
.light-theme,
.dark-theme {
  a {
    color: $link-color;

    &:hover {
      color: $link-hover-color;
    }
  }
}

// 滚动条
::-webkit-scrollbar {
  width: 8px;
  background: $scrollbar-bg;
}

::-webkit-scrollbar-track-piece {
  padding: 0 2px;
}

::-webkit-scrollbar-thumb {
  // 滚动的滑块
  border-radius: 4px;
  background: $border-color;
}






// 初始化一些常用的 margin、paddding、font-size 的值
@mixin init-size($base, $min, $max) {

  @for $dis from $min to $max {
    .pdl-#{$dis} {
      padding-left: $dis * $base;
    }

    .pdr-#{$dis} {
      padding-right: $dis * $base;
    }

    .pdt-#{$dis} {
      padding-top: $dis * $base;
    }

    .pdb-#{$dis} {
      padding-bottom: $dis * $base;
    }

    .mal-#{$dis} {
      margin-left: $dis * $base;
    }

    .mar-#{$dis} {
      margin-right: $dis * $base;
    }

    .mat-#{$dis} {
      margin-top: $dis * $base;
    }

    .mab-#{$dis} {
      margin-bottom: $dis * $base;
    }

    .fs-#{$dis} {
      font-size: $dis + $base;
    }
  }

}

// 调用
@include init-size(10px, 1, 11);

// 边框
$bor-directions: top,
left,
right,
bottom,
all,
none;

// 将最可能改的地方放前面
@mixin border-direction($color: $border-color, $type: solid, $size: 1px) {
  @each $direc in $bor-directions {

    // 全边框
    @if $direc==all {
      .bor-#{$direc} {
        border: $size $type $color;
      }
    }

    // 无边框
    @else if $direc==none {
      .bor-#{$direc} {
        border: none;
      }
    }

    // 单边框
    @else {
      .bor-#{$direc} {
        border-#{$direc}: $size $type $color;
      }
    }

  }
}

@include border-direction();


// 浮动
$floats: (l: left, r:right, n:none);

@each $name,
$fl in $floats {
  .f#{$name} {
    float: $fl;
  }
}

// 文本对齐
$tas: (l:left, r:right, c:center);

@each $name,
$ta in $tas {
  .ta#{$name} {
    text-align: $ta;
  }
}